﻿using System;
using System.Web;
using DMS.Business.Utility;

namespace DMS.Business.EventHanlder
{
    public class ErrorLog : IHttpModule
    {

        #region IHttpModule Members

        public void Dispose()
        {
            //throw new NotImplementedException();
        }

        public void Init(HttpApplication context)
        {
            context.Error += new System.EventHandler(context_Error);
        }

        private void context_Error(object sender, EventArgs e)
        {
            HttpContext context = HttpContext.Current;
            Exception lastException = context.Server.GetLastError();

            LogHelper.LogException(lastException);
        }

        #endregion
    }
}
